/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package inet.controller;

import inet.dao.DepartmentDAO;
import inet.entity.Department;
import inet.entity.Position;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

/**
 *
 * @author ÂuNgọcThái
 */
@ManagedBean
@SessionScoped
public class DepartmentController extends BranchController {

    /**
     * Creates a new instance of DepartmentController
     */
    Department dep = null;
    Position posi = null;
    DepartmentDAO depDAO = null;
    List<Department> lstDep = null;

    public DepartmentController() {
        dep = new Department();
        posi = new Position();
        depDAO = new DepartmentDAO();
        lstDep = new ArrayList();
    }

    public Position getPosi() {
        return posi;
    }

    public void setPosi(Position posi) {
        this.posi = posi;
    }

    public Department getDep() {
        return dep;
    }

    public void setDep(Department dep) {
        this.dep = dep;
    }

    public DepartmentDAO getDepDAO() {
        return depDAO;
    }

    public void setDepDAO(DepartmentDAO depDAO) {
        this.depDAO = depDAO;
    }

    public List<Department> getLstDep() {
        return lstDep;
    }

    public void setLstDep(List<Department> lstDep) {
        this.lstDep = lstDep;
    }

    public List<Department> getLstDepartment() {
        depDAO = new DepartmentDAO();
        lstDep = depDAO.getAll();
        return lstDep;
    }

    public List<Department> getLstdepBranch() {
        depDAO = new DepartmentDAO();
        lstDep = depDAO.getDepinBranch(getBranch().getBranch_id());
        return lstDep;
    }
//    public List<Department> getLstDepartmentByID(){
//        depDAO = new DepartmentDAO();
//        lstDep = depDAO.getAllByID(branchID());      
//        return lstDep;
//    }
}
